
package cn.com.cifi.mars.web.action.operateplan;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.com.cifi.mars.bean.vo.supply.SupplyPlanVersionDataVO;
import cn.com.cifi.mars.bean.vo.supply.SupplyPlanVersionsVO;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
 * 类名称：ISupplyPlan 
 * 类描述：供货计划API 
 * 创建人：yyd 
 * 创建时间：2019年9月4日 上午10:45:53
 * 
 * @version 1.0.0
 */
@Api(tags = "供货计划API")
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/supplyPlan")
public interface ISupplyPlanController {

	@ApiOperation(value = "创建供货计划版本【后台测试用】", notes = "基于价格版本生产供货计划版本（审批通过的价格版本）")
	@PostMapping(value = "castDecisionVersion")
	public R createSupplyPlanVersion(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "价格版本Id", required = true) @RequestParam(value = "priceVersionId") String priceVersionId,
			@ApiParam(value = "版本类型(investment-投资版 、strategy-战规版 、dynamic-动态版)", required = true, defaultValue = "") @RequestParam(name = "versionType") String versionType);

	@ApiOperation(value = "货值定稿创建供货计划版本【后台测试用】", notes = "基于价格版本生产供货计划版本")
	@PostMapping(value = "finalizeCreateSupplyPlanVersion")
	public R finalizeCreateSupplyPlanVersion(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "价格版本Id", required = true) @RequestParam(value = "priceVersionId") String priceVersionId,
			@ApiParam(value = "版本类型(investment-投资版 、strategy-战规版 、dynamic-动态版)", required = true, defaultValue = "") @RequestParam(name = "versionType") String versionType);

	@ApiOperation(value = "供货计划最新的版本阶段", notes = "根据项目分期获取供货计划最新的版本阶段")
	@GetMapping(value = "newestVersionStage")
	public R<String> newestVersionStage(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "分期ID", required = true) @RequestParam(value = "projectFid") String projectFid);

	@ApiOperation(value = "供货计划版本列表", notes = "供货计划版本列表")
	@GetMapping(value = "versionList")
	public R<List<SupplyPlanVersionsVO>> versionList(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "分期ID", required = true) @RequestParam(value = "projectFid") String projectFid,
			@ApiParam(value = "版本类型(investment-投资版 、strategy-战规版 、budget-预算版 、dynamic-动态版)", required = true, defaultValue = "") @RequestParam(name = "versionType") String versionType);

	@ApiOperation(value = "供货计划版本信息", notes = "根据项目分期及对应的版本Id获取供货计划投资版、战规版、预算版、动态版 版本信息")
	@GetMapping(value = "supplyPlanVersion")
	public R<List<SupplyPlanVersionDataVO>> getVersionData(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "供货计划版本ID", required = true, defaultValue = "") @RequestParam(value = "versionId") String versionId,
			@ApiParam(value = "层级类型(已废弃)", required = false) @RequestParam(value = "type", required = false) String type,
			@ApiParam(value = "层级Code", required = false) @RequestParam(value = "code", required = false) String code);

	@ApiOperation(value = "判断是否已存在预算版", notes = "创建供货计划预算版版本时，判断是否已存在预算版")
	@GetMapping(value = "isExistBudgetVersion")
	public R isExistBudgetVersion(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "分期Id", required = true) @RequestParam(name = "projectFid") String projectFid);

	@ApiOperation(value = "手动创建供货计划预算版新版本", notes = "创建供货计划预算版新版本")
	@PostMapping(value = "supplyPlanVersion")
	public R createSupplyBudgetVersion(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "分期Id", required = true) @RequestParam(name = "projectFid") String projectFid);

	@ApiOperation(value = "导出报表", notes = "根据项目分期及版本导出版本信息")
	@GetMapping(value = "overAllValueExport")
	public void overAllValueExport(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			HttpServletRequest request, HttpServletResponse response,
			@ApiParam(value = "项目Id", required = true) @RequestParam(value = "projectId") String projectId,
			@ApiParam(value = "层级Code", required = false) @RequestParam(value = "code", required = false) String code);

	@ApiOperation(value = "全盘供货计划年份", notes = "全盘供货计划年份接口")
	@GetMapping(value = "overAllYears")
	public R overAllYears(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目Id", required = true) @RequestParam(value = "projectId") String projectId);

	@ApiOperation(value = "全盘供货计划货值", notes = "全盘供货计划货值")
	@GetMapping(value = "overAllValue")
	public R overAllValue(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目Id", required = true) @RequestParam(value = "projectId") String projectId,
			@ApiParam(value = "年份", required = false) @RequestParam(value = "year", required = false) String year,
			@ApiParam(value = "层级类型(已废弃)", required = false) @RequestParam(value = "type", required = false) String type,
			@ApiParam(value = "层级Code", required = false) @RequestParam(value = "code", required = false) String code);

	@ApiOperation(value = "设置投资版考核标签", notes = "设置投资版考核标签")
	@PutMapping(value = "setAssessmentTag")
	public R setAssessmentTag(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "版本Id", required = true) @RequestParam(name = "versionId") String versionId,
			@ApiParam(value = "分期ID", required = true) @RequestParam(name = "projectFid") String projectFid);

	@ApiOperation(value = "修改投资版考核标签", notes = "重新设置投资版考核标签")
	@PutMapping(value = "updateAssessmentTag")
	public R updateAssessmentTag(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "重新设置版本Id", required = true) @RequestParam(name = "versionId") String versionId,
			@ApiParam(value = "分期ID", required = true) @RequestParam(name = "projectFid") String projectFid);

	@ApiOperation(value = "是否需要供货确认（项目PM）", notes = "是否需要供货确认")
	@GetMapping(value = "isNeedSpplyConfirm")
	public R isNeedSpplyConfirm(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目ID", required = false) @RequestParam(value = "projectId", required = false) String projectId);

	@ApiOperation(value = "供货确认详情页面（项目PM）", notes = "供货确认详情")
	@GetMapping(value = "supplyConfirmDetail")
	public R supplyConfirmDetail(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目ID", required = true) @RequestParam(value = "id", required = true) String id,
			@ApiParam(value = "版本时间", required = true) @RequestParam(value = "versionDate", required = true) String versionDate);

	@ApiOperation(value = "供货确认详情页面（事业部/集团）", notes = "供货确认详情")
	@GetMapping(value = "SupplyConfirmDetailTwo")
	public R supplyConfirmDetailTwo(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目名称", required = false) @RequestParam(value = "projectName", required = false) String projectName,
			@ApiParam(value = "确认状态（0--未确认；1--已确认）", required = false) @RequestParam(value = "status", required = false) Integer status,
			@ApiParam(value = "版本时间", required = true) @RequestParam(value = "versionDate", required = true) String versionDate);

	@ApiOperation(value = "供货确认导出", notes = "供货确认导出-集团级")
	@GetMapping(value = "supplyConfirmExport")
	public void supplyConfirmExport(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			HttpServletRequest request, HttpServletResponse response,
			@ApiParam(value = "项目名称", required = false) @RequestParam(value = "projectName", required = false) String projectName,
			@ApiParam(value = "确认状态（0--未确认；1--已确认）", required = false) @RequestParam(value = "status", required = false) Integer status,
			@ApiParam(value = "版本时间", required = true) @RequestParam(value = "versionDate", required = true) String versionDate);

	@ApiOperation(value = "是否显示供货确认（项目PM）", notes = "供货确认按钮是否显示")
	@GetMapping(value = "isShowSupplyConfirm")
	public R isShowSupplyConfirm(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目ID", required = true) @RequestParam(value = "projectId", required = true) String projectId,
			@ApiParam(value = "版本时间", required = true) @RequestParam(value = "versionDate", required = true) String versionDate);

	@ApiOperation(value = "供货确认（项目PM）", notes = "供货确认")
	@PutMapping(value = "supplyConfirm")
	public R supplyConfirm(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目ID", required = true) @RequestParam(name = "projectId", required = true) String projectId,
			@ApiParam(value = "版本时间", required = true) @RequestParam(value = "versionDate", required = true) String versionDate);

	@ApiOperation(value = "取消供货确认（集团）", notes = "取消供货确认")
	@PutMapping(value = "cancelSupplyConfirm")
	public R cancelSupplyConfirm(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目ID", required = true) @RequestParam(name = "projectId", required = true) String projectId,
			@ApiParam(value = "版本时间", required = true) @RequestParam(value = "versionDate", required = true) String versionDate);

	@ApiOperation(value = "供货计划版本对比详情", notes = "供货计划版本对比详情")
	@GetMapping(value = "versionCompareDetail")
	public R versionCompareDetail(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目ID", required = true) @RequestParam(name = "projectId", required = true) String projectId,
			@ApiParam(value = "截止时间(yyyy-MM)", required = false) @RequestParam(name = "deadline", required = false) String deadline);

	
	
	@ApiOperation(value = "发送供货确认待办任务(单个项目)【后台测试用】", notes = "供货确认待办任务（手动处理）")
	@PostMapping(value = "sendToDoMsg")
	public R sendToDoMsg(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目ID", required = true) @RequestParam(name = "projectId") String projectId,
			@ApiParam(value = "版本ID", required = true) @RequestParam(name = "versionId") String versionId);
	
	@ApiOperation(value = "发送供货确认待办任务（批量处理）--同月底前两天定时任务【后台测试用】", notes = "供货确认待办任务（手动处理）")
	@GetMapping(value = "sendSupplyConfirmTask")
	public R sendSupplyConfirmTask(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion);

	@ApiOperation(value = "消除供货确认待办消息(单个项目)--同供货确认消除待办【后台测试用】", notes = "消除供货确认待办")
	@PostMapping(value = "cleanToDo")
	public R cleanToDo(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "项目ID", required = true) @RequestParam(name = "projectId") String projectId);
	
	@ApiOperation(value = "消除逾期没确认待办任务(批量)--同每月1号6点定时任务【后台测试用】", notes = "手动消除逾期没确认待办任务")
	@GetMapping(value = "closeSupplyConfirmTask")
	public R closeSupplyConfirmTask(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion);

	
	@ApiOperation(value = "刷新供货确认数据【后台测试用】", notes = "刷新供货确认数据")
	@GetMapping(value = "handleConfirmSupplyData")
	public R handleConfirmSupplyData(
			@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
			@ApiParam(value = "分期Id", required = false) @RequestParam(name = "projectFid", required = false) String projectFid,
			@ApiParam(value = "是否过滤已签约（0-过滤掉；1-不过滤）", required = false) @RequestParam(name = "isSign", required = false) String isSign,
			@ApiParam(value = "是否全量", defaultValue = "0") @RequestParam(name = "isAll", required = false) String isAll,
			@ApiParam(value = "归属月份", required = true) @RequestParam(name = "affiliationMonth", required = true) String affiliationMonth);

}
